package com.elangzhi.ssm.model;

import com.elangzhi.ssm.model.base.BaseModel;

import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

public class Demand extends BaseModel{
    private Long id;

    private String title;

    private BigDecimal price;

    private Long sendUserId;

    private Long receiveUserId;

    private Date setTime;

    private Date receiveTime;

    private String province;

    private String city;

    private String district;

    private String address;

    private String content;

    /**
     * 1,待承接
     * 2，待完成
     * 3，交易完成，等待客户评价承接人
     * 4，等待承接人评价客户
     * 5，成功。
     */
    private Integer status;

    //自定义列
    private String sendUserName;
    private String receiveUserName;
    private User sendUser;
    private User receiveUser;
    private List<Image> bannerList;

    public Demand(Long id, String title, BigDecimal price, Long sendUserId, Long receiveUserId, Date setTime, Date receiveTime, String province, String city, String district, String address, String content) {
        this.id = id;
        this.title = title;
        this.price = price;
        this.sendUserId = sendUserId;
        this.receiveUserId = receiveUserId;
        this.setTime = setTime;
        this.receiveTime = receiveTime;
        this.province = province;
        this.city = city;
        this.district = district;
        this.address = address;
        this.content = content;
    }

    public Demand() {
        super();
    }

    public String getSendUserName() {
        return sendUserName;
    }

    public void setSendUserName(String sendUserName) {
        this.sendUserName = sendUserName;
    }

    public String getReceiveUserName() {
        return receiveUserName;
    }

    public void setReceiveUserName(String receiveUserName) {
        this.receiveUserName = receiveUserName;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public User getSendUser() {
        return sendUser;
    }

    public void setSendUser(User sendUser) {
        this.sendUser = sendUser;
    }

    public User getReceiveUser() {
        return receiveUser;
    }

    public void setReceiveUser(User receiveUser) {
        this.receiveUser = receiveUser;
    }

    public List<Image> getBannerList() {
        return bannerList;
    }

    public void setBannerList(List<Image> bannerList) {
        this.bannerList = bannerList;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Long getSendUserId() {
        return sendUserId;
    }

    public void setSendUserId(Long sendUserId) {
        this.sendUserId = sendUserId;
    }

    public Long getReceiveUserId() {
        return receiveUserId;
    }

    public void setReceiveUserId(Long receiveUserId) {
        this.receiveUserId = receiveUserId;
    }

    public Date getSetTime() {
        return setTime;
    }

    public String getSetTime(String patt){
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(patt);
        return simpleDateFormat.format(this.setTime);
    }
    public void setSetTime(Date setTime) {
        this.setTime = setTime;
    }

    public Date getReceiveTime() {
        return receiveTime;
    }

    public void setReceiveTime(Date receiveTime) {
        this.receiveTime = receiveTime;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getDistrict() {
        return district;
    }

    public void setDistrict(String district) {
        this.district = district;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }
}